{include file="public/user_head" /}
<body>
<div class="page-body">

    {include file="public/user_dh" /}><div class="content">
    <table style="width: 100%;">
        <thead style="color:red;text-align:center;font-size:12px">
        <tr>
            <td>发送人</td>
            <td>收件人</td>
            <td>时间</td>
            <td>操作</td>
        </tr>
        </thead>
        <tbody style="background: #ffffff;">
        <tr><td colspan="99">暂无记录</td></tr>
        <div class="shouhuodizhi" id="shouhuodizhi" style="display:none;">
            <div style="padding:20px 50px;">
                <form class="form-horizontal">
                    <div class="form-group">
                        <label for="x1" class="col-sm-3 control-label">收信人:</label>
                        <div class="col-sm-9">
                            <input style="width:100%" class="form-control" value = "[管理员]" readonly id="x1" >
                            <br>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="x2" class="col-sm-3 control-label">发送内容:</label>
                        <div class="col-sm-9">
                            <textarea style="width:100%;height:200px" class="form-control" rows="3" id="x2"  placeholder="短信内容"></textarea>
                        </div>
                    </div>
                    <div class="form-group"></div>
                    <div class="form-group">
                        <div class="col-sm-12">
                            <button type="submit" class="btn btn-primary btn-block" onClick="xiexxgo(this);return false;">发送信息</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>

        <script>
            $("#mlindex").addClass("btn-long16");
            var indexdd;
            $(".goneirong").click(function(e) {
                var ti=$(this);
                var data="id="+encodeURI(ti.attr("cid"));
                var uid=ti.parent().parent().attr('uid');
                var tit=ti.text();
                $.post("/mobile/bin.php?act=msg_get",data,function(e){
                        tishi2close();
                        if(e!=""){
                            $(ti).parent().parent().find("span[mread='1']").removeClass('youjian');
                            if(uid){
                                layer.msg(tit+':<br>'+unescape(e),{time: 20000,skin: 'long-class', btn: ['马上回复', '取消'],btn1: function(){
                                        location='msg.php';
                                    }})
                            }else{

                                layer.msg(tit+':<br>'+unescape(e),{time: 20000,skin: 'long-class', btn: ['确定'],btn1: function(){}})
                            }
                        }
                    },'html'
                );


                return false;
            });


            $("#xiexinxi").click(function(e) {
                indexdd=layer.open({type: 1,title:'写信息',area: '90%',skin: 'layui-layer-rim',content: $("#shouhuodizhi")});
            });


            function xiexxgo(t){
                var top=$(t).parent().parent().parent();
                var x1=top.find("#x1").val();
                var x2=top.find("#x2").val();
                if(!checkMobile(x1) && x1 != '[管理员]'){
                    tishi4('玩家编号不正确',top.find("#x1"));
                    return false;
                }
                if(x2==''){
                    tishi4('请填写短信内容',top.find("#x2"));
                    return false;
                }
                var data="username="+encodeURI(x1)+"&info="+encodeURI(x2);
                $.post("/mobile/bin.php?act=msg_post",data,function(e){
                        tishi2close();
                        if(e!=""){
                            layer.msg(unescape(e),{time: 500,shade: 0.3,end:function(){
                                    if (unescape(e)=="信件已发出"){window.location.href='/mobile/msg.php?clause=out';}
                                }})
                        }
                    },'html'
                );
                return false;
            }

        </script>

</div>
    <script type="text/javascript">
        $(".head-icon-left").on("click", function () {
            window.history.go(-1);
        });
    </script>
    {include file="public/footer" /}
</body>
</html>